The invention relates generally to data processing apparatus and in particular to an apparatus for processing decimal digits.
Data processing apparatus operate according to a binary arithmetic, and generally process numerical data by converting the data to a binary number representation. Programming languages, such as COBOL, however, execute a large number of decimal instructions and therefore, if the data is to be processed as a binary number, each decimal string of binary coded decimal (BCD) represented decimal digits must be converted to a pure binary number, operated upon, by for example the arithmetic unit of the machine, and then converted back to its original (or a different) BCD representation. This is a time consuming task. Furthermore, where decimal data is commonly output, the conversion can introduce undesirable round off errors which occur because of the decimal to binary to decimal conversion. To avoid this, the decimal data can be stored and manipulated as either packed or unpacked binary coded decimal (BCD).
The problem of increasing the throughput in a digital processing apparatus which processes large quantities of decimal data has been generally approached by using special decimal processing hardware or a combination of hardware and software methods. Thus, there exist arithmetic processors which operate upon BCD data and provide BCD data at their output. These processors however are limited to a specific type of packed or unpacked BCD data and are thereby limited to an operating environment in which the input data can be either packed BCD or one of several classes of unpacked BCD data. The output is typically of the same class as the input data class.
In order to accommodate various classes of BCD input and output data, therefore, several "superminicomputers" have employed microcode algorithms to handle the various standard types of packed and unpacked BCD data. However, the use of microcode algorithms inherently reduces the throughput of the apparatus and therefore limits the performance of the apparatus for handling BCD data.
Objects of the invention are therefore an increased processing throughput while handling both packed and unpacked BCD data, improved flexibility in handling arithmetic operations using BCD data without converting the data to a pure binary representation, a compact and reliable VLSI chip structure for providing a hardware implementation for decimal arithmetic, and a hardware implementation for decimal arithmetic which minimizes the use of microcode for its implementation and operation.